aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/[username]
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/[username]')
-rw-r--r--src/routes/[username]/receive/+page.server.js20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/routes/[username]/receive/+page.server.js b/src/routes/[username]/receive/+page.server.js
index 60e94f0e..1068f273 100644
--- a/src/routes/[username]/receive/+page.server.js
+++ b/src/routes/[username]/receive/+page.server.js
@@ -1,21 +1,5 @@
-import { auth, get, post } from '$lib/utils';
-import { redirect } from '@sveltejs/kit';
+import invoice from '$lib/invoice';
export const actions = {
- default: async ({ cookies, request }) => {
- let form = await request.formData();
-
- let invoice = {
- amount: parseInt(form.get('amount')),
- network: 'lightning',
- prompt: form.get('prompt') === 'true',
- rate: await get('/rate')
- };
-
- let user = { username: form.get('username') };
-
- let { uuid } = await post('/invoice', { invoice, user }, auth(cookies));
-
- throw redirect(307, `/invoice/${uuid}`);
- }
+ default: invoice
};